<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String basepath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath() + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    
<style>
.body_top>div{
    width: 870px;
    height: 85px;

    margin:0 auto;
    padding-top:10px; 
}
.body_top>div>p{
    font-family:"微软雅黑";
    color: #90c624;
    font-size:40px;
    font-weight:900;
    display: inline-block;
}
.body_top>div>span{
    font-size: 14px;
    color: #8f8f8f;
    float: right;
    margin-top: 20px;
}
.body_top>div>a>img{
    float: right;
    margin: 17px 5px;
}
.body_top>div>div{
    display: inline-block;
}
.body_top>div>div>p{
    font-weight:500;
    letter-spacing: 2px;
    font-size: 18px;
    color: #8f8f8f;
}
.body_top>div>div>.last_p{
    color: #90c624;
    font-size: 12px;
    letter-spacing: 0px;
}
.body_wrap{
    width: 100%;
    background: #f7f7f7;
    padding-top: 50px;
}
.body_wrap .middle{
    width: 870px;
    height: 450px;
    margin: 0 auto;
}
.body_wrap .middle .left{
    float: left;
    margin-left: 15px;
}
.body_wrap .left_top{
    background: #90c624;
    width: 180px;
    height: 120px;
    color: #fff;
    padding-top: 20px;
    font-size: 20px;
    text-align: center;
}
.body_wrap .left_top .last_p{
    font-size: 16px;
}
.body_wrap .left_botton{
    width: 180px;
    height: 225px;
    background: #fff;
    font-size: 15px;
    color: #6d6d6d;
}
.body_wrap .left_botton>p>a{
    display: inline-block;
    padding:10px 58px;
    text-decoration:none;
    color: #848482;
}
.botton_p_click,.body_wrap .left_botton>p>a:hover{
    background: #f0f0f0;
    border-left: 3px solid #96c720;
}
.body_wrap .right{
    float: left;
    padding-left: 20px; 
}
.body_wrap .right p{
    line-height: 48px;
    color:#848482;
}
.body_wrap .right p b{
    margin-right: 10px;
    cursor: pointer;
    padding:3px 10px;
    background: #f0f0f0;
}
.body_wrap .right #txtBeginDate{
    width:120px;
    padding:2px 10px;
    border:1px solid #ccc;
}
.body_wrap .right #start_s,#start_f,#end_s,#end_f{
    width: 60px;
    padding:2px 10px;
    border:1px solid #ccc;
}
.body_wrap .right p>input{
    width: 500px;
    height: 25px;
    border:1px solid #ccc;
    }
.body_wrap .right p>span{
    color: #848482;
    display: inline-block;
    width: 130px;
    text-align: center;
}
.body_wrap .right p textarea{
    width: 500px;
    float: right;
    height: 120px;
    resize:none;
}
#commit{
    border: 1px solid #fff;
    width: 100px;
    height: 35px;
    background-color:#96c720 ;
    border-radius: 5px;
    display: block;
    margin: auto;
    margin-top: 15px;
    color:#fff;
}

</style>
<script>
	<% if(request.getAttribute("pjax_back") != null && !request.getAttribute("pjax_back").equals("")) {%> 
		<%=(String)request.getAttribute("pjax_back") %>
	<% } %>
	</script>
    <div class="body_top">
        <div>
            <p>场地预约</p>
            <div>
                <p>enue booking</p>
                <p class="last_p">HI BUSINESS.LET YOU BECOME A SUCCESS</p>
            </div>
            <a href="index"><img src="img/btn.png"></a>
            <span>当前位置：<span>首页</span>><span>场地预约</span></span>
        </div>
    </div>
    <div class="body_wrap">
        <div class="middle">
            <div class="left">
                <div class="left_top">
                    <p>ENTEPRENEURIAL</p>
                    <p>COUNSELING</p>
                    <p class="last_p">创业辅导</p>
                </div>
                <div class="left_botton">
                    <p><a href="index_cdyy" class="botton_p1 botton_p_click">场地预约</a></p>
                    <p><a  data-cdid="botton_p2" href="index_cdyy_Receipt">查看回执</a></p>
                </div>
            </div>
            <div class="right" id="main_right">
                    <p><span>请选择预约场所：</span>
                    <c:forEach items="${requestScope.field }" var="field">
                    	<b id="${field.ft_id}">${field.ft_name }</b>
                    </c:forEach>
                    </p>
                    <p>
                    <span>请选择日期：</span>
                    <input id="txtBeginDate"/>
                    <select size="1" id="start_s">
                        <option>00</option>
                        <option>01</option>
                        <option>02</option>
                        <option>03</option>
                        <option>04</option>
                        <option>05</option>
                        <option>06</option>  
                        <option>07</option>
                        <option>08</option>
                        <option>09</option>
                        <option>10</option>
                        <option>11</option>
                        <option>12</option>
                        <option>13</option>
                        <option>14</option>
                        <option>15</option>
                        <option>16</option>
                        <option>17</option>
                        <option>18</option>
                        <option>19</option>  
                        <option>20</option>
                        <option>21</option>
                        <option>22</option>
                        <option>23</option>
                    </select>
                    <select id="start_f">
                        <option>00</option>
                        <option>01</option>
                        <option>02</option>
                        <option>03</option>
                        <option>04</option>
                        <option>05</option>
                        <option>06</option>  
                        <option>07</option>
                        <option>08</option>
                        <option>09</option>
                        <option>10</option>
                        <option>11</option>
                        <option>12</option>
                        <option>13</option>
                        <option>14</option>
                        <option>15</option>
                        <option>16</option>
                        <option>17</option>
                        <option>18</option>
                        <option>19</option>  
                        <option>20</option>
                        <option>21</option>
                        <option>22</option>
                        <option>23</option>
                        <option>24</option>
                        <option>25</option>
                        <option>26</option>  
                        <option>27</option>
                        <option>28</option>
                        <option>29</option>
                        <option>30</option>
                        <option>31</option>
                        <option>32</option>
                        <option>33</option>
                        <option>34</option>
                        <option>35</option>
                        <option>36</option>  
                        <option>37</option>
                        <option>38</option>
                        <option>39</option>
                        <option>40</option>
                        <option>41</option>
                        <option>42</option>
                        <option>43</option>
                        <option>44</option>
                        <option>45</option>
                        <option>46</option>  
                        <option>47</option>
                        <option>48</option>
                        <option>49</option>
                        <option>50</option>
                        <option>51</option>
                        <option>52</option>
                        <option>53</option>
                        <option>54</option>
                        <option>55</option>
                        <option>56</option>  
                        <option>57</option>
                        <option>58</option>
                        <option>59</option>
                    </select>--
                    <select id="end_s">
                        <option>00</option>
                        <option>01</option>
                        <option>02</option>
                        <option>03</option>
                        <option>04</option>
                        <option>05</option>
                        <option>06</option>  
                        <option>07</option>
                        <option>08</option>
                        <option>09</option>
                        <option>10</option>
                        <option>11</option>
                        <option>12</option>
                        <option>13</option>
                        <option>14</option>
                        <option>15</option>
                        <option>16</option>
                        <option>17</option>
                        <option>18</option>
                        <option>19</option>  
                        <option>20</option>
                        <option>21</option>
                        <option>22</option>
                        <option>23</option>
                    </select>
                    <select id="end_f">
                        <option>00</option>
                        <option>01</option>
                        <option>02</option>
                        <option>03</option>
                        <option>04</option>
                        <option>05</option>
                        <option>06</option>  
                        <option>07</option>
                        <option>08</option>
                        <option>09</option>
                        <option>10</option>
                        <option>11</option>
                        <option>12</option>
                        <option>13</option>
                        <option>14</option>
                        <option>15</option>
                        <option>16</option>
                        <option>17</option>
                        <option>18</option>
                        <option>19</option>  
                        <option>20</option>
                        <option>21</option>
                        <option>22</option>
                        <option>23</option>
                        <option>24</option>
                        <option>25</option>
                        <option>26</option>  
                        <option>27</option>
                        <option>28</option>
                        <option>29</option>
                        <option>30</option>
                        <option>31</option>
                        <option>32</option>
                        <option>33</option>
                        <option>34</option>
                        <option>35</option>
                        <option>36</option>  
                        <option>37</option>
                        <option>38</option>
                        <option>39</option>
                        <option>40</option>
                        <option>41</option>
                        <option>42</option>
                        <option>43</option>
                        <option>44</option>
                        <option>45</option>
                        <option>46</option>  
                        <option>47</option>
                        <option>48</option>
                        <option>49</option>
                        <option>50</option>
                        <option>51</option>
                        <option>52</option>
                        <option>53</option>
                        <option>54</option>
                        <option>55</option>
                        <option>56</option>  
                        <option>57</option>
                        <option>58</option>
                        <option>59</option>
                    </select>
                    </p>
                
                    <p><span>申请人：</span><input type="text" size="20" id="name"></p>
                    <p><span>联系方式：</span><input type="text" size="4" id="dh"></p>   
                    <p class="clearfix"><span>补充说明</span><textarea name="" id="" ></textarea>
                    </p>
                    <input id="commit" type="submit" value="提交">
            </div>
        </div>
    </div>

<script type="text/javascript">
    //选择日期--时间，分钟
     $(function(){
        // var a = $("#end_s").val();
        // var b = $("#start_s").val();
        // if(a>b){
        //     alert("cuowu");
        // }
        
        $(".body_wrap .right p b").click(function(){
            $(this).addClass("cd");
            $(this).siblings().removeClass("cd");
            $(this).css("background","red");
            $(this).siblings().css("background","#f0f0f0");
        })
        $("#commit").click(function(){
        	var cdh = $("div.right>p>b ").attr("id");
            var day = $("#txtBeginDate").val();
            var start_s = $("#start_s").val();
            var start_f = $("#start_f").val();
            var start = start_s + ":" + start_f + ":00";
            var end_s = $("#end_s").val();
            var end_f = $("#end_f").val();
            var end = end_s + ":" + end_f + ":00";
            var sqr = $(".right").children().eq(2).children('input').val();
            var lxdh = $(".right").children().eq(3).children('input').val();
            var sm = $(".right").children().eq(4).children('textarea').val();
    		$.ajax({
    			type: "post",
    			url: "index_cdyy",
    			data: { ft_id:cdh, stardate:day, startime:start, endtime:end, peoper:sqr, tel:lxdh, explain:sm},
    			dataType: "text",
    			success:function(data){
    				if(data == false) {
    					alert("申请提交失败，如果没登录请先登录！");
    				} else {
    					alert("申请提交成功，请及时查看回执！");
    				}
    			}
    		})
        })
     })

  $(".botton_p2").click(function(){
        $(this).attr('class', 'botton_p_click');
        $(this).siblings().attr('class', '');
     })
  $(".botton_p1").click(function(){
        $(this).attr('class', 'botton_p_click');
        $(this).siblings().attr('class', '');
    }) 
  //选择日期

     /*  $(function () {
        $("#txtBeginDate").calendar({
  
            controlId: "divDate",                                // 弹出的日期控件ID，默认: $(this).attr("id") + "Calendar"
            speed: 200,                                           // 三种预定速度之一的字符串("slow", "normal", or "fast")或表示动画时长的毫秒数值(如：1000),默认：200
            complement: true,                                     // 是否显示日期或年空白处的前后月的补充,默认：true
            readonly: true,                                       // 目标对象是否设为只读，默认：true
            upperLimit: new Date(),                               // 日期上限，默认：NaN(不限制)
            lowerLimit: new Date("2011/01/01"),                   // 日期下限，默认：NaN(不限制)
            callback: function () {                               // 点击选择日期后的回调函数
                alert("您选择的日期是：" + $("#txtBeginDate").val());
            }
        });
        $("#txtEndDate").calendar();
       // alert("123");
    }); */



</script>